import request from '../utils/request';//导入帮助类里面的request对象，帮助我们发送请求给后端api接口

//定时任务列表（定时任务分页组合查询）
export const getTimingList = query => {
    return request({
        url: '/api/Timing/GetTimingList',
        method: 'get',//get请求用params
        params: query
    });
};

//反射
export const AfterTiming = query => {
    return request({
        url: '/api/Timing/After',
        method: 'get',//get请求用params
        params: query
    });
};

//定时任务添加
export const AddTiming = query => {
    return request({
        url: '/api/Timing/AddTiming',
        method: 'post',
        data: query
    });
};
//定时任务删除
export const DeleteTiming = id => {
    return request({
        url: '/api/Timing/AllFormDelete',
        method: 'delete',
        data:id
    });
};
//定时任务编辑
export const UpdateTiming = query => {
    return request({
        url: '/api/Timing/UpdateTiming',
        method: 'put',
        data: query
    });
};
//根据主键获取定时任务
export const QueryIdTiming = id => {
    return request({
        url: '/api/Timing/TimingQueryId?id='+id,
        method: 'get'
    });
};

//启动Job任务
export const StartScheduleJob = query => {
    return request({
        url: '/api/Timing/StartScheduleJob',
        method: 'post',
        data: query
    });
};

//暂停Job任务
export const PauseScheduleJob = query => {
    return request({
        url: '/api/Timing/PauseScheduleJob',
        method: 'delete',
        data: query
    });
};